/*Joseph A. Coll
Cleaning Data for Racial Polarization and Vote Confidence
2/6/2025 */

********************************************************************************
********************************************************************************
********************************************************************************
**# *2016
********************************************************************************
********************************************************************************
********************************************************************************
use "G:\My Drive\Backup 08202022\Data Sets\ANES\2016\anes_timeseries_2016_dta\anes_timeseries_2016_Stata13.dta", clear

*Race
fre V161310x
*drop if V161310x != 1
gen white_non_hispanic = .
replace white_non_hispanic = 1 if V161310x ==1 
replace white_non_hispanic = 0 if V161310x !=1 & V161310x != .
label var white_non_hispanic White

*Ethnicity
tab V161319x
tab V161319x, nol

*Vote confidence
tab V162219 if V162219 >0
tab V162219
tab V162219, nol
recode V162219 (-9/-6=.) (1=5 "All of the time") (2=4 "Most of the Time") (3=3 "About half of the time") (4=2 "Some of the time") (5=1 "Never"), gen(vote_conf)
label var vote_conf "Voter Confidence"
tab vote_conf

*Vote confidence
tab V162219 if V162219 >0
tab V162219
tab V162219, nol
recode V162219 (-9/-6=.) (1=5 "All of the time") (2=4 "Most of the Time") (3=3 "About half of the time") (4=2 "Some of the time") (5=1 "Never"), gen(vote_conf_2016)
label var vote_conf_2016 "Voter Confidence"
tab vote_conf_2016

*Racial Resentment
tab V162211
tab V162211, nol
recode V162211 (-9/-5=3) (1=5 "S. Agree") (2=4 "Agree") (3=3 "Neither") (4=2 "Disagree") (5=1 "S. Disagree"), gen(rr_work)
label var rr_work "BLACKS SHOULD WORK THEIR WAY UP WITHOUT SPECIAL FAVORS"
tab rr_work

tab V162212
tab V162212, nol
recode V162212 (-9/-5=3) (1=1 "S. Agree") (2=2 "Agree") (3=3 "Neither") (4=4 "Disagree") (5=5 "S. Disagree"), gen(rr_slavery)
label var rr_slavery "PAST SLAVERY & DISCRIMINATION MAKE IT DIFFICULT FOR BLACKS"
tab rr_slavery

tab V162213
tab V162213, nol
recode V162213 (-9/-5=3) (1=1 "S. Agree") (2=2 "Agree") (3=3 "Neither") (4=4 "Disagree") (5=5 "S. Disagree"), gen(rr_deserve)
label var rr_deserve "AGREE/DISAGREE: BLACKS HAVE GOTTEN LESS THAN THEY DESERVE"
tab rr_deserve

tab V162214
tab V162214, nol
recode V162214 (-9/-5=3) (1=5 "S. Agree") (2=4 "Agree") (3=3 "Neither") (4=2 "Disagree") (5=1 "S. Disagree"), gen(rr_tried)
label var rr_tried "IF BLACKS TRIED HARDER THEY'D BE AS WELL OFF AS WHITES"
tab rr_tried

alpha rr_work rr_slavery rr_deserve rr_tried, item
gen rr_scale = rr_work + rr_slavery + rr_deserve + rr_tried
tab rr_scale
replace rr_scale = (rr_scale-4)/16
label var rr_scale "Racial Resentment"
tab rr_scale

*(PRE)Political Interest to Politics/Elections
tab V161003
tab V161003, nol
recode V161003 (1=4 "High") (2=3 "Moderately High") (3=2 "Moderately Low") (-9 4/5 =1 "Low"), gen(poli_int_politics)
label var poli_int_politics "Political Interest"
tab poli_int_politics

*(PRE)Political Interest to Campaigns
tab V161004
tab V161004, nol
recode V161004 (1=3 "High") (2=2 "Medium") (-9 3=1 "Low"), gen(poli_int_camps)
label var poli_int_camps "Political Interest"
tab poli_int_camps

*Voter turnout
tab V162031
tab V162031, nol
recode V162031 (-1/3=0 "Did not Vote") ( 4=1 "Voted"), gen(voted)
label var voted Voted
tab voted

*Vote choice
tab V162034a
tab V162034a, nol
recode V162034a (2=1 "Trump Voter") (-9/-1=0) (1 3/12=0 "Non-Trump Voter"), gen(trump_voter)
label var trump_voter "Trump Voter"

*Ideology
tab V161126
tab V161126, nol
recode V161126 (1=1 "V. Lib.") (2=2 "Lib.") (3=3 "S. Lib.") (-9 -8 4 99= 4 "Moderate") (5=5 "S. Cons.") (6=6 "Cons.") (7=7 "V. Cons."), gen(conservativism)
label var conservativism Conservativism
tab conservativism

*Age
tab V161267
sum V161267 if V161267 >0
recode V161267 (-9=51), gen(age)
label var age Age
tab age

*Marital status
tab V161268
tab V161268, nol
recode V161268 (1/2=1 "Married") (-9/-8 3/6=0 "Not Married"), gen(married)
label var married Married
tab married

*Education
tab V161270
tab V161270, nol
sum V161270 if V161270 <95 & V161270 >0
recode V161270 (1/8=1 "<HS") (9 90=2 "HS Grad.") (10=3 "Some Coll.") (-9 -8 11 12 95=4 "Assoc.") (13=5 "Bach.") (14=6 "MA") (15/16=7 "Adv."), gen(educ)
label var educ Education
tab educ

*Income
tab V161361x
sum V161361x if V161361x >0
clonevar income_mean = V161361x 
recode income_mean (-9/-1=8)
label var income_mean Income
tab income_mean 

*Partisanship
tab V161158x
tab V161158x, nol
recode V161158x (1/3=1 "Democrat") (-9 -8 4/7=0 "Not Democrat"), gen(dem_w_lean)
label var dem_w_lean "Democrat"
tab dem_w_lean 

tab V161158x
tab V161158x, nol
recode V161158x (5/7=1 "Republican") (-9 -8 1/4=0 "Not Republican"), gen(rep_w_lean)
label var rep_w_lean "Republican"
tab rep_w_lean 

tab V161158x
tab V161158x, nol
recode V161158x (-9 -8 4=1 "Independent") (1/3 5/7=0 "Not Independent"), gen(ind_no_lean)
label var ind_no_lean"Independent"
tab ind_no_lean

*Political knowledge
*Party in House (REP)
tab V161515
tab V161515, nol
recode V161515 (2=1 "Correct") (-9/-5 1=0 "Incorrect"), gen(know_party_house)
label var know_party_house "Knows PiG: House"

*Party in Senate (DEM)
tab V161516
tab V161516, nol
recode V161516 (1=1 "Correct") (-9/-5 2=0 "Incorrect"), gen(know_party_sen)
label var know_party_sen "Knows PiG: House"

	alpha know_party_sen know_party_house
	gen know_party_ingov_index = know_party_house + know_party_sen
	label var know_party_ingov_index "Political Knowledge"
	tab know_party_ingov_index

*White Racial Importance
tab V162327
tab V162327, nol
recode V162327 (1=5 "Extremely Important") (2=4 "Very Important") (3=3 "Moderately Important") (4=2 "A Little Important") (5=1 "Not at all Important") (-9/-1=5), gen(racial_importance)
label var racial_importance "Racial Importance"
tab racial_importance

*Asian
tab V162310
tab V162310, nol
recode V162310 (-9/-4=50), gen(ft_asian)
label var ft_asian "Asian Therm."
tab ft_asian

*Black FT
tab V162312
tab V162312, nol
recode V162312 (-9/-4=50), gen(ft_black)
label var ft_black "Black Therm."
tab ft_black

*White FT
tab V162314
tab V162314, nol
recode V162314 (-9/-4=50), gen(ft_white)
label var ft_white "White Therm."
tab ft_white

*Latino FT
tab V162311
tab V162311, nol
recode V162311 (-9/-4=50), gen(ft_lat)
label var ft_lat "Latino Therm."
tab ft_lat

*Illegal immigrants FT
tab V162313
tab V162313, nol
recode V162313 (-99/-4=50), gen(ft_ii)
label var ft_ii "Illegal Immig. Therm."
tab ft_ii

*Democrat FT
tab V161095
tab V161095, nol
recode V161095 (-99/-4 998=50), gen(ft_dem)
label var ft_dem "Democratic Party Therm."
tab ft_dem

*Republican FT
tab V161096
tab V161096, nol
recode V161096 (-99/-4=50), gen(ft_rep)
label var ft_rep "Republican Party Therm."
tab ft_rep

*Democrat Pres FT
tab V161086
tab V161086, nol
recode V161086 (-99/-4=50), gen(ft_dem_cand)
label var ft_dem_cand "Democartic Party Cand. Therm."
tab ft_dem_cand

*Republican Pres FT
tab V161087
tab V161087, nol
recode V161087 (-99/-4=50), gen(ft_rep_cand)
label var ft_rep_cand "Republican Party Cand. Therm."
tab ft_rep_cand

*Liberals
tab V162097
tab V162097, nol
recode V162097 (-99/-4 998 999=50), gen(ft_libs)
label var ft_libs "Liberal Therm."
tab ft_libs

*Conservatives
tab V162101
tab V162101, nol
recode V162101 (-99/-4 998 999=50), gen(ft_cons)
label var ft_cons "Conservative Therm."
tab ft_cons

*Same-sex 
tab V162103
tab V162103, nol
recode V162103 (-99/-4 998 999=50), gen(ft_gay)
label var ft_gay "Gay and Lesbian Therm."
tab ft_gay
sum ft_gay

*Difference
gen rap_wa = ft_white - ft_asian
tab rap_wa 
label var rap_wa "RAP: White-Asian"

gen rap_wb = ft_white - ft_black
tab rap_wb 
label var rap_wb "RAP: White-Black"

gen rap_wl = ft_white - ft_lat
tab rap_wl 
label var rap_wl "RAP: White-Latino"

gen rap_wii = ft_white - ft_ii
tab rap_wii 
label var rap_wii "RAP: White-Illegal Immig."

gen pap = ft_dem - ft_rep if dem_w_lean ==1
replace pap = ft_rep - ft_dem if rep_w_lean ==1
label var pap "PAP"
tab pap 

gen plap = ft_dem_cand - ft_rep_cand if dem_w_lean ==1
replace plap = ft_rep_cand - ft_dem_cand if rep_w_lean ==1
label var plap "PLAP"
tab plap 

gen iap = ft_libs - ft_cons if conservativism <4
replace iap = ft_cons - ft_libs if conservativism >4
label var iap "IAP"
tab iap 

clonevar rap_wa_2016 = rap_wa
clonevar rap_wb_2016 = rap_wb
clonevar rap_wl_2016 = rap_wl
clonevar rap_wii_2016 = rap_wii
clonevar pap_2016 = pap
clonevar plap_2016 = plap
clonevar iap_2016 = iap

local vars rap_wa_2016 rap_wb_2016 rap_wl_2016 rap_wii_2016 pap_2016 plap_2016 iap_2016
foreach x of local vars {
recode `x' (-100/-1=-1 "Decreased RAP") (0=0 "No Change") (1/100=1 "Increased RAP"), gen(`x'3)
}

/*Media use

*Sean hannity 
V161430

*TV Hannity
V161370

*Wesbite fox news
V161452
*/

*State
tab V163001a
tab V163001a, nol
statastates, fips(V163001a)
replace state_name = proper(state_name)

*Year
gen year =2016

*Weight
tab V160102
tab V160102, nol
clonevar weight_post_full = V160102


save "G:\My Drive\Backup 08202022\Working Papers\Racial Polarization and Vote Confidence\Data and Methods\2016 ANES Cleaned.dta", replace
use "G:\My Drive\Backup 08202022\Working Papers\Racial Polarization and Vote Confidence\Data and Methods\2016 ANES Cleaned.dta", clear

sum vote_conf vote_conf_2016 rr_work rr_slavery rr_deserve rr_tried rr_scale poli_int_politics poli_int_camps voted trump_voter conservativism age married educ income_mean dem_w_lean rep_w_lean ind_no_lean know_party_house know_party_sen know_party_ingov_index racial_importance ft_asian ft_black ft_white ft_lat ft_ii ft_dem ft_rep ft_dem_cand ft_rep_cand ft_libs ft_cons ft_gay rap_wa rap_wb rap_wl rap_wii pap plap iap rap_wa_2016 rap_wb_2016 rap_wl_2016 rap_wii_2016 pap_2016 plap_2016 iap_2016 rap_wa_20163 rap_wb_20163 rap_wl_20163 rap_wii_20163 pap_20163 plap_20163 iap_20163

********************************************************************************
********************************************************************************
********************************************************************************
**# *2020
********************************************************************************
********************************************************************************
********************************************************************************
use "G:\My Drive\Backup 08202022\Data Sets\ANES\2020\anes_timeseries_2020_stata_20220210\anes_timeseries_2020_stata_20220210.dta", clear

*Race
tab V201549x
*drop if V201549x != 1
gen white_non_hispanic = .
replace white_non_hispanic = 1 if V201549x ==1 
replace white_non_hispanic = 0 if V201549x !=1 & V201549x != .
label var white_non_hispanic White

*Ethnicity
tab V201546
tab V201546, nol

*Vote confidence
tab V202219 if V202219 >0
tab V202219
tab V202219, nol
recode V202219 (-9/-5=.) (1=5 "All of the time") (2=4 "Most of the Time") (3=3 "About half of the time") (4=2 "Some of the time") (5=1 "Never"), gen(vote_conf)
label var vote_conf "Voter Confidence"
tab vote_conf

*Vote confidence
tab V202219 if V202219 >0
tab V202219
tab V202219, nol
recode V202219 (-9/-5=.) (1=5 "All of the time") (2=4 "Most of the Time") (3=3 "About half of the time") (4=2 "Some of the time") (5=1 "Never"), gen(vote_conf_2020)
label var vote_conf_2020 "Voter Confidence"
tab vote_conf_2020

gen vote_conf_2016 = .

*Partisanship
tab V201231x
tab V201231x, nol
recode V201231x (1/3=1 "Democrat") (-9 -8 4/7=0 "Not Democrat"), gen(dem_w_lean)
label var dem_w_lean "Democrat"
tab dem_w_lean 

tab V201231x
tab V201231x, nol
recode V201231x (5/7=1 "Republican") (-9 -8 1/4=0 "Not Republican"), gen(rep_w_lean)
label var rep_w_lean "Republican"
tab rep_w_lean 

tab V201231x
tab V201231x, nol
recode V201231x (-9 -8 4=1 "Independent") (1/3 5/7=0 "Not Independent"), gen(ind_no_lean)
label var ind_no_lean"Independent"
tab ind_no_lean

*Conspiracy thinking
tab V202311
tab V202311, nol
recode V202311 (-9/-5=3) (1=1 "Not at all") (2=2 "Not very well") (3=3 "Somewhat well") (4=4 "Very well") (5=5 "Extremely Well"), gen(consp_control)
label var consp_control "Conspiracy: Powerful People Control Business/Politics"
tab consp_control

tab V202312
tab V202312, nol
recode V202312 (-9/-5=3) (1=1 "Not at all") (2=2 "Not very well") (3=3 "Somewhat well") (4=4 "Very well") (5=5 "Extremely Well"), gen(consp_lies)
label var consp_lies "Conspiracy: School/Media is Lies from People in Power"
tab consp_lies

alpha consp_lies consp_control

gen consp_scale = consp_control + consp_lies
tab consp_scale
replace consp_scale = (consp_scale-2)/8
tab consp_scale 
label var consp_scale "Conspiracy Thinking"
tab consp_scale 

*Racial Resentment
tab V202300
tab V202300, nol
tab V202300 if V202300 >0
recode V202300 (-9/-5=5) (1=5 "S. Agree") (2=4 "Agree") (3=3 "Neither") (4=2 "Disagree") (5=1 "S. Disagree"), gen(rr_work)
label var rr_work "BLACKS SHOULD WORK THEIR WAY UP WITHOUT SPECIAL FAVORS"
tab rr_work

tab V202301
tab V202301, nol
tab V202301 if V202301 >0 
recode V202301 (-9/-5=2) (1=1 "S. Agree") (2=2 "Agree") (3=3 "Neither") (4=4 "Disagree") (5=5 "S. Disagree"), gen(rr_slavery)
label var rr_slavery "PAST SLAVERY & DISCRIMINATION MAKE IT DIFFICULT FOR BLACKS"
tab rr_slavery

tab V202302
tab V202302, nol
tab V202302 if V202302 >0 
recode V202302 (-9/-5=3) (1=1 "S. Agree") (2=2 "Agree") (3=3 "Neither") (4=4 "Disagree") (5=5 "S. Disagree"), gen(rr_deserve)
label var rr_deserve "AGREE/DISAGREE: BLACKS HAVE GOTTEN LESS THAN THEY DESERVE"
tab rr_deserve

tab V202303
tab V202303, nol
tab V202303 if V202303 >0 
recode V202303 (-9/-5=1) (1=5 "S. Agree") (2=4 "Agree") (3=3 "Neither") (4=2 "Disagree") (5=1 "S. Disagree"), gen(rr_tried)
label var rr_tried "IF BLACKS TRIED HARDER THEY'D BE AS WELL OFF AS WHITES"
tab rr_tried

alpha rr_work rr_slavery rr_deserve rr_tried, item
gen rr_scale = rr_work + rr_slavery + rr_deserve + rr_tried
tab rr_scale
replace rr_scale = (rr_scale-4)/16
tab rr_scale
label var rr_scale "Racial Resentment"

*Political Interest to Politics/Elections
tab V201005
tab V201005, nol
recode V201005 (1=4 "High") (2=3 "Moderately High") (3=2 "Moderately Low") (-9 4/5 =1 "Low"), gen(poli_int_politics)
label var poli_int_politics "Political Interest"
tab poli_int_politics

*Political Interest to Campaigns
tab V201006
tab V201006, nol
recode V201006 (1=3 "High") (2=2 "Medium") (-9 3=1 "Low"), gen(poli_int_camps)
label var poli_int_camps "Political Interest"
tab poli_int_camps

*Voter turnout
tab V202109x
tab V202109x, nol
recode V202109x (-2 0 =0 "Did not Vote") ( 1=1 "Voted"), gen(voted)
label var voted Voted
tab voted

*Ideology
tab V201200
tab V201200, nol
recode V201200 (1=1 "V. Lib.") (2=2 "Lib.") (3=3 "S. Lib.") (-9 -8 4 99= 4 "Moderate") (5=5 "S. Cons.") (6=6 "Cons.") (7=7 "V. Cons."), gen(conservativism)
label var conservativism Conservativism
tab conservativism

recode V201200 (1/3=1 "Lib.") (-9 -8 4 99= 2 "Moderate") (5/7=3 "Cons."), gen(conservativism3)
label var conservativism3 Conservativism
tab conservativism3

*Vote choice
tab V202073
tab V202073, nol
recode V202073 (2=1 "Trump Voter") (-9/-1=0) (1 3/12=0 "Non-Trump Voter"), gen(trump_voter)
label var trump_voter "Trump Voter"

*Age
tab V201507x
sum V201507x if V201507x >0
recode V201507x (-9=53), gen(age)
label var age Age
tab age

*Marital status
tab V201508
tab V201508, nol
recode V201508 (1/2=1 "Married") (-9/-8 3/6=0 "Not Married"), gen(married)
label var married Married
tab married

*Education
tab V201510
tab V201510, nol
tab V201510 if V201510 <95 & V201510 >0
sum V201510 if V201510 <95 & V201510 >0
recode V201510 (1=1 "<HS") (2=2 "HS Grad.") (3=3 "Some Coll.") (-9 -8 4/5 95=4 "Assoc.") (6=5 "Bach.") (7=6 "MA") (8=7 "Adv."), gen(educ)
label var educ Education
tab educ

*Income
tab V202468x
sum V202468x if V202468x >0
clonevar income_mean = V202468x 
recode income_mean (-9/-1=7)
label var income_mean Income
tab income_mean 

*Political knowledge
*Party in House
tab V201646
tab V201646, nol
recode V201646 (1=1 "Correct") (-9/-5 2=0 "Incorrect"), gen(know_party_house)
label var know_party_house "Knows PiG: House"

*Party in Senate
tab V201647
tab V201647, nol
recode V201647 (1=1 "Correct") (-9/-5 2=0 "Incorrect"), gen(know_party_sen)
label var know_party_sen "Knows PiG: House"

	alpha know_party_sen know_party_house
	gen know_party_ingov_index = know_party_house + know_party_sen
	label var know_party_ingov_index "Political Knowledge"
	tab know_party_ingov_index

*White Racial Importance
tab V202499x
tab V202499x, nol
recode V202499x (1=5 "Extremely Important") (2=4 "Very Important") (3=3 "Moderately Important") (4=2 "A Little Important") (5=1 "Not at all Important") (-9/-1=5), gen(racial_importance)
label var racial_importance "Racial Importance"
tab racial_importance

*Does State Reguire ID?
tab V201363
tab V201363, nol
recode V201363 (1=1 "Thinks State Requires ID") (2=-1 "Does Not Think State Requires ID") (-9/-8 3=0 "Unsure"), gen(thinks_has_id)
label var thinks_has_id "Thinks State Requires ID"

*Asian
tab V202477
tab V202477, nol
recode V202477 (-9/-1=50), gen(ft_asian)
label var ft_asian "Asian Therm."
tab ft_asian

*Black FT
tab V202480
tab V202480, nol
recode V202480 (-9/-4=50), gen(ft_black)
label var ft_black "Black Therm."
tab ft_black

*White FT
tab V202482
tab V202482, nol
recode V202482 (-9/-4=50), gen(ft_white)
label var ft_white "White Therm."
tab ft_white

*Latino FT
tab V202479
tab V202479, nol
recode V202479 (-9/-4=50), gen(ft_lat)
label var ft_lat "Latino Therm."
tab ft_lat

*Illegal immigrants FT
tab V202481
tab V202481, nol
recode V202481 (-9/-4=50), gen(ft_ii)
label var ft_ii "Illegal Immig. Therm."
tab ft_ii

*Democrat FT
tab V201156
tab V201156, nol
recode V201156 (-9/-4 998=50), gen(ft_dem)
label var ft_dem "Democratic Party Therm."
tab ft_dem

*Republican FT
tab V201157
tab V201157, nol
recode V201157 (-9/-4=50), gen(ft_rep)
label var ft_rep "Republican Party Therm."
tab ft_rep

*Democrat Pres FT
tab V202143
tab V202143, nol
recode V202143 (-99/-4=50), gen(ft_dem_cand)
label var ft_dem_cand "Democartic Party Cand. Therm."
tab ft_dem_cand

*Republican Pres FT
tab V202144
tab V202144, nol
recode V202144 (-99/-4=50), gen(ft_rep_cand)
label var ft_rep_cand "Republican Party Cand. Therm."
tab ft_rep_cand

*Liberals
tab V202161
tab V202161, nol
recode V202161 (-99/-1 999=50), gen(ft_libs)
label var ft_libs "Liberal Therm."
tab ft_libs

*Conservatives
tab V202164
tab V202164, nol
recode V202164 (-99/-1 999=50), gen(ft_cons)
label var ft_cons "Conservative Therm."
tab ft_cons

*Same-sex 
tab V202166
tab V202166, nol
recode V202166 (-99/-4 998=50), gen(ft_gay)
label var ft_gay "Gay and Lesbian Therm."
tab ft_gay

*Difference
gen rap_wa = ft_white - ft_asian
tab rap_wa 
label var rap_wa "RAP: White-Asian"

gen rap_wb = ft_white - ft_black
tab rap_wb 
label var rap_wb "RAP: White-Black"

gen rap_wl = ft_white - ft_lat
tab rap_wl 
label var rap_wl "RAP: White-Latino"

gen rap_wii = ft_white - ft_ii
tab rap_wii 
label var rap_wii "RAP: White-Illegal Immig."

gen pap = ft_dem - ft_rep if dem_w_lean ==1
replace pap = ft_rep - ft_dem if rep_w_lean ==1
label var pap "PAP"
tab pap 

gen plap = ft_dem_cand - ft_rep_cand if dem_w_lean ==1
replace plap = ft_rep_cand - ft_dem_cand if rep_w_lean ==1
label var plap "PLAP"
tab plap 

gen iap = ft_libs - ft_cons if conservativism <4
replace iap = ft_cons - ft_libs if conservativism >4
label var iap "IAP"
tab iap 

clonevar rap_wa_2020 = rap_wa
clonevar rap_wb_2020 = rap_wb
clonevar rap_wl_2020 = rap_wl
clonevar rap_wii_2020 = rap_wii
clonevar pap_2020 = pap
clonevar plap_2020 = plap
clonevar iap_2020 = iap

local vars rap_wa_2020 rap_wb_2020 rap_wl_2020 rap_wii_2020 pap_2020 plap_2020 iap_2020
foreach x of local vars {
recode `x' (-100/-1=-1 "Decreased RAP") (0=0 "No Change") (1/100=1 "Increased RAP"), gen(`x'3)
}

label var rap_wa_20203 "RAP: White-Asian"
label var rap_wb_20203 "RAP: White-Black"
label var rap_wl_20203 "RAP: White-Latino"
label var rap_wii_20203 "RAP: White-Illegal Immig."
label var pap_20203 "PAP"
label var plap_20203 "PLAP"
label var iap_20203 "IAP"

*Media use

*State
tab V203000
tab V203000, nol
statastates, fips(V203000)
replace state_name = proper(state_name)

*Year
gen year =2020

*Weight
tab V200010b
tab V200010b, nol
clonevar weight_post_full = V200010b

save "G:\My Drive\Backup 08202022\Working Papers\Racial Polarization and Vote Confidence\Data and Methods\2020 ANES Cleaned.dta", replace








